package com.ruoyi.project.system.mapper;

import java.util.List;

import com.ruoyi.project.system.domain.College;
import com.ruoyi.project.system.domain.SysUser;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.security.core.parameters.P;

/**
 * 院校Mapper接口
 * 
 * @author ruoyi
 * @date 2020-10-07
 */
@Mapper
public interface CollegeMapper 
{
    /**
     * 查询院校
     * 
     * @param collegeId 院校ID
     * @return 院校
     */
    public College selectCollegeById(Integer collegeId);

    /**
     * 查询院校列表
     * 
     * @param college 院校
     * @return 院校集合
     */
    public List<College> selectCollegeList(College college);

    /**
     * 新增院校
     * 
     * @param college 院校
     * @return 结果
     */
    public int insertCollege(College college);

    /**
     * 修改院校
     * 
     * @param college 院校
     * @return 结果
     */
    public int updateCollege(College college);

    /**
     * 删除院校
     * 
     * @param collegeId 院校ID
     * @return 结果
     */
    public int deleteCollegeById(Integer collegeId);

    /**
     * 批量删除院校
     * 
     * @param collegeIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteCollegeByIds(Integer[] collegeIds);

    College selectCollegeByCollegeName(String collegeName);


    College selectCollegeByCode(String code);

    @Update("UPDATE course set count=count+1 where id  = #{id}")
    void updateCount(@Param("id") long longValue);



    List<College> selectCollegeXzList(College college);

    @Delete("delete  from college_staff  where college_id = #{collegeId}")
    Integer deleteByCollegeId(Integer collegeId);
}
